from threading import Lock


# from multiprocessing import Lock

def func():
    with lock:
        print("互斥锁使用不当，就会出现这样的死锁。")


if __name__ == '__main__':
    lock = Lock()
    with lock:
        func()
